#include "key.h"  

void key_init(void)
{
	
  RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
	RCC->APB2ENR |= RCC_APB2ENR_IOPAEN;
	
	GPIOC->CRH |= GPIO_CRH_CNF9_1;
	GPIOC->CRH &= ~GPIO_CRH_CNF9_0;
	GPIOC->CRH &= ~GPIO_CRH_MODE9;
	
	GPIOC->CRH |= GPIO_CRH_CNF8_1;
	GPIOC->CRH &= ~GPIO_CRH_CNF8_0;
	GPIOC->CRH &= ~GPIO_CRH_MODE8;
	
	GPIOA->CRL |= GPIO_CRL_CNF0_1;
	GPIOA->CRL &= ~GPIO_CRL_CNF0_0; 
	GPIOA->CRL &= ~GPIO_CRL_MODE0;
	
	
	GPIOC->ODR |= GPIO_ODR_ODR9;
	GPIOC->ODR |= GPIO_ODR_ODR8;
	GPIOA->ODR &= ~GPIO_ODR_ODR0;
	
}